<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title>全局属性</title>
        <!--在html中通过script元素嵌入JavaScript脚本-->
        <script type="text/javascript">
            // 在 `global object` 上定义的属性(部分)

            const g = window;

            console.log( '值属性' );
            console.log( g.Infinity ); // 无穷大
            console.log( g.NaN ); // not a number
            console.log( g.undefined ); // undefined
            // globalThis 表示 `global object` 本尊
            console.log( g.globalThis === window ); // true

            console.log( '函数属性' );
            console.log( g.eval );
            console.log( g.isFinite );
            console.log( g.isNaN );
            console.log( g.parseFloat );
            console.log( g.parseInt );
            console.log( g.decodeURI );
            console.log( g.decodeURIComponent );
            console.log( g.encodeURI );
            console.log( g.encodeURIComponent );

            console.log( '-'.repeat(20) );

            console.log( g.setInterval );
            console.log( g.clearInterval );
            console.log( g.setTimeout );
            console.log( g.clearTimeout );
            console.log( g.queueMicrotask );
            console.log( g.setImmediate );
            console.log( g.clearImmediate );

        </script>
    </head>
    <body>
        <h1>global object</h1>
        <p>请在浏览器终端中查看运行结果</p>
    </body>
</html>